﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Midi;

namespace MIDIRemapper.DeviceInterfaces
{
    partial class DeviceInterface
    {
        public List<Transformable> routes = new List<Transformable>();

        /// <summary>
        /// Add a transformation.
        /// </summary>
        /// <param name="t_in">MIDIType of input midi message</param>
        /// <param name="i_in">Specification of input midi message</param>
        /// <param name="t_out">MIDIType of output midi message</param>
        /// <param name="i_out">Specification of output midi message</param>
        public void AddTransformation(MidiType t_in, int i_in, MidiType t_out, int i_out)
        {
            routes.Add(new Transformable(t_in, t_out, programIn: i_in, programOut: i_out));
        }

        public void AddTransformation(Transformable route)
        {
            routes.Add(route);
        }

        public void RemoveTransformation(int i)
        {
            routes.Remove(routes.ElementAt(i));
        }

        public void LoadTransformations(List<Transformable> transformations)
        {
            routes = transformations;
        }

        public List<Transformable> GetTransformations()
        {
            return routes;
        }

    }
}
